package com.woniu.controller;

import com.woniu.dto.DepositDTO;
import com.woniu.dto.PendingDepositQueryDTO;
import com.woniu.dto.PendingSettleQueryDTO;
import com.woniu.dto.SettleDTO;
import com.woniu.service.FinanceService;
import com.woniu.utils.ResponseUtil;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/finance")
public class FinanceController {
    @Resource
    private FinanceService financeService;

    @PostMapping("/pay-deposit")
    public ResponseUtil payDeposit(@RequestBody DepositDTO dto) {
        return financeService.payDeposit(dto);
    }

    @PostMapping("/settle-discharge")
    public ResponseUtil settleDischarge(@RequestBody SettleDTO dto) {
        return financeService.settleDischarge(dto);
    }
    //查询“待缴押金”列表
    @PostMapping("/pending-deposits")
    public ResponseUtil getPendingDeposits(@RequestBody PendingDepositQueryDTO queryDTO) {
        return financeService.listPendingDeposits(queryDTO);
    }
    //查询“待结算”列表
    @PostMapping("/pending-settlements")
    public ResponseUtil getPendingSettlements(@RequestBody PendingSettleQueryDTO queryDTO) {
        return financeService.listPendingSettlements(queryDTO);
    }
}
